package com.example.demo04.entity;

import com.google.gson.Gson;
import lombok.Data;

import java.math.BigDecimal;
import java.util.*;

/**
 * @author admin
 * @Description ${Description}
 * @date 2020-07-18 11:14:00
 */
@Data
public class StStoreOrder {

    /**
     * 订单id
     */
    private String orderId;

    /**
     * 所属经销商编号
     */
    private String distributorId;

    /**
     * 定制内容
     */
    private String customContent;

    /**
     * 客户姓名
     */
    private String customerName;

    private List<StStoreOrderDetail> stStoreOrderDetailList;

    public static void main(String[] args) {
        Map<String, Map<String, List<StStoreOrderDetail>>> map = new HashMap<>(16);
        StStoreOrder stStoreOrder = new StStoreOrder();
        stStoreOrder.setCustomContent("11");
        StStoreOrderDetail stStoreOrderDetail = new StStoreOrderDetail();
        stStoreOrderDetail.setOrderId("2.1");
        List<StStoreOrderDetail> stStoreOrderDetails = new ArrayList<>();
        stStoreOrderDetails.add(stStoreOrderDetail);
        stStoreOrder.setStStoreOrderDetailList(stStoreOrderDetails);
        Course course = new Course();
        course.setCId("3.1");
        List<Course> objectCourseList = new ArrayList<>();
        objectCourseList.add(course);
        stStoreOrderDetail.setCourses(objectCourseList);
        StStoreOrderDetail stStoreOrderDetail2 = new StStoreOrderDetail();
        stStoreOrderDetail2.setOrderDetailId("2.2");
        stStoreOrderDetails.add(stStoreOrderDetail2);
        Course course01 = new Course();
        course01.setCId("3.2");
        List<Course> objectCourseList01 = new ArrayList<>();
        objectCourseList01.add(course01);
        stStoreOrderDetail2.setCourses(objectCourseList01);
        Map<String, List<StStoreOrderDetail>> maps = new HashMap<>(16);
        maps.put("list11", stStoreOrderDetails);
        maps.put("list22", stStoreOrderDetails);
        map.put("test", maps);
        String json = new Gson().toJson(map);
        System.out.println("json = " + json);
        String jsonFormat = new Gson().toJson(stStoreOrder);
        System.out.println(jsonFormat);
    }
}